<?php
namespace Home\Controller;
use Think\Controller;
use Think\Page;
header("Content-type: text/html; charset=utf-8");
class IndexController extends Controller {
    public function index($id=0){
		/* $news = M('news');
    	$count = $news->count();
    	$page = new \Think\Page($count,5);
    	$show = $page->show();
    	$list = $news->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
    	$this->assign('list',$list);
    	$this->assign('page',$show);
    	$this->display(); */
    	
    	$m = M('news');
    	$p = getpage($m, $where,4);
    	$list = $m->field(true)->where($where)->order('id desc')->select();
    	$show = $p->show();
    	$this->assign('list',$list);
    	$this->assign('page',$show);
    	$this->display();
    }
    
}